<?php
use core\Route;

// 注册路由
// 默认应用路由
Route::get('/', ['IndexController', 'index']);
Route::get('/hello', ['IndexController', 'hello']);

// Admin应用路由组 - 使用前缀和中间件
Route::group(['prefix' => '/admin', 'middleware' => ['AuthMiddleware']], function() {
    Route::get('/', ['IndexController', 'index']);
    Route::get('/users', ['IndexController', 'users']);
    // 可以添加更多路由
});

// Open应用路由组
Route::group(['prefix' => '/open'], function() {
    Route::get('/', ['IndexController', 'index']);
    Route::get('/login', ['IndexController', 'login']);
    Route::post('/doLogin', ['IndexController', 'doLogin']);
    Route::get('/register', ['IndexController', 'register']);
    Route::post('/doRegister', ['IndexController', 'doRegister']);
    Route::get('/logout', ['IndexController', 'logout']);
    // 可以添加更多路由
});

// API路由组 - 使用前缀和多个中间件
Route::group(['prefix' => '/api'], function() {
    Route::get('/user', ['UserController', 'user']);
    Route::post('/update', ['UserController', 'update']);
    // 可以添加更多路由
});